Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/calcagnoloic/invoice-app-server

Backend application and invoice application database. Contains the various CRUD routes and a backup of dummy data.
https://github.com/calcagnoloic/invoice-app-server

crud docker-compose fastapi mariadb python unitest

Last synced: about 1 month ago
JSON representation

Backend application and invoice application database. Contains the various CRUD routes and a backup of dummy data.

Awesome Lists containing this project

README

        

# Invoice App Server

🚧 Please note that the application is currently under development and is only available locally. To run it on your computer, please refer [here](https://github.com/CalcagnoLoic/invoice-app-web?tab=readme-ov-file#launching-frontend-server) for frontend installation. Thank you for your understanding.🚧







## Launching backend `docker compose`

πŸ›‘With docker compose, locally, the database is persisted but not made available on github. To access the data in the database, you'll find a file called `data.sql` in the app folder. To use it, start docker compose and connect to the Adminer service. πŸ›‘

To connect to the database service, simply write these environment variables to a file named `.env` at the root of app folder. These variables is dummy data. During the development phase, these variables will no longer be available.

```
MARIADB_USER=admin@invoice-app
MARIADB_PASSWORD=f*Ap-uidtp
MARIADB_DATABASE=invoice_app
MARIADB_ROOT_PASSWORD=root
```

Then you can run this command:

```cmd
docker compose up
```

οΈπŸ‘¨β€πŸ”§οΈ ***WARNING***, it is possible that the backend service crashes on first execution with this message πŸ‘¨β€πŸ”§

```
️backend-1 | sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'database' ([Errno 111] Connection refused)")
```

πŸ‘¨β€πŸ”§If so, just restart the service from docker desktop. πŸ‘¨β€πŸ”§

Once all services are up and running, go to adminer (http://localhost:8080/) and log in with MARIADB data. On the left, you'll see the β€œImport” action. All you have to do is select the sql file and your database is ready! πŸ₯³

## User Stories

Your users should be able to:

- [ ] Create, read, update, and delete invoices In Progress
- [x] Bonus: Build this project as a full-stack application

## Built with

- Python 3.12 - FastAPI
- Docker 4.30

## Authors

- Personnal website - [Portfolio](https://calcagno-loic.netlify.app/)
- Frontend Mentor - [@CalcagnoLoic](https://www.frontendmentor.io/profile/CalcagnoLoic)
- Linkedin - [LinkedIn](https://www.linkedin.com/in/loic-calcagno/)