The File/CSV Manager is a web application designed for managing file uploads and CSV data. The frontend is built with Angular, leveraging Angular Material for the user interface, while the backend is powered by Symfony and MySQL.
-
Root Directory:
- Dockerfile: For dockerization.
- src Folder: Contains the main application code.
-
src/app Folder:
- Modules:
- Login-Register Module: Handles authentication and authorization.
- Admin Module: Provides a dashboard for uploading and viewing CSV files.
- Guards:
- Route Guards: Prevent unauthorized access.
- For logged-in users.
- For logged-out users.
- Route Guards: Prevent unauthorized access.
- Interceptors:
- Request Interceptors:
- Attach authorization headers to every request.
- Intercept errors to handle unauthorized access or expired tokens by logging out the user.
- Request Interceptors:
- Services:
- Authentication Service: Manages user login and registration.
- File Service: Handles file creation, reading, and updating.
- Shared Modules:
- Shared Modules: Common functionalities for login and registration.
- Admin Modules: Common functionalities for the dashboard.
- Modules:
- Clone the repository:
git clone https://github.com/mrpanday93/file-manager-dashboard-angular
- Navigate to the project directory and install dependencies:
cd file-manager-dashboard-angular npm install
- Ensure Angular CLI is installed and Node.js version 18+ is available.
- Run the application:
ng serve
- Tests are available in the
services
andregister
component spec files. - Run tests using:
ng test
- Install Symfony on your system.
- Clone the repository:
git clone https://github.com/mrpanday93/symfony-7-crud
- Update the
.env
file with local variables. - Install dependencies:
composer install
- Generate JWT keys:
mkdir -p config/jwt openssl genpkey -algorithm RSA -out config/jwt/private.pem -pkeyopt rsa_keygen_bits:2048 openssl rsa -pubout -in config/jwt/private.pem -out config/jwt/public.pem
- Create and migrate the database:
php bin/console doctrine:database:create php bin/console make:migration php bin/console doctrine:migrations:migrate
- Start the server:
symfony serve:start
- Build the Docker image:
docker build . -t angular
- Run the Docker container:
docker run -p 4201:4200 angular
- Build and run the Docker container:
docker-compose up --build -d
- Execute migrations:
docker-compose exec symfony_php php bin/console make:migration docker-compose exec symfony_php php bin/console doctrine:migrations:migrate
- Generate JWT keys:
docker-compose exec symfony_php mkdir -p config/jwt docker-compose exec symfony_php openssl genpkey -algorithm RSA -out config/jwt/private.pem -pkeyopt rsa_keygen_bits:4096 docker-compose exec symfony_php openssl rsa -pubout -in config/jwt/private.pem -out config/jwt/public.pem
You can also access your Symfony PHP container through Docker Desktop or the command line:
docker exec -it symphony_php bash
-
Authentication:
- POST
/api/login
- User login - POST
/api/register
- User registration
- POST
-
File Management:
- GET
/api/files
- List all files - POST
/api/files
- Upload a new file - GET
/api/files/{id}
- Retrieve a file - PUT
/api/files/{id}
- Update a file
- GET