About | Features | Technologies | Requirements | Starting | License | Authors
Implementation of web app + API to remotely monitor and manage an Arduino-based CNC machine.
✔️ REST API
✔️ SQL database management
✔️ Real time monitoring of CNC status
The following tools were used in this project:
- Web app, frontend: Next.js with Typescript
- Containerization: Docker
- API: FastAPI
- Database: PostgreSQL
- ORM: SQLAlchemy
- DB migrations: Alembic
- Server, reverse proxy: Nginx
Before starting 🏁, you need to have installed:
- Node to run the Next.js app in developer mode and generate the frontend pages for production,
- Python to run the backend,
- Nginx to configure a production server and
- PostgreSQL
Alternatively, if you have Docker installed, you can build and run the whole application, both in development and production mode, without installing the aforementioned programs.
More information about how to init your development environment here.
# Clone this project
$ git clone --recurse-submodules https://github.com/Leandro-Bertoluzzi/remote-cnc-workgroup
# Access
$ cd remote-cnc-workgroup
# Run the project
$ docker compose up
# The first time, you may want to run DB migrations
# Command to run the DB schema migrations
$ docker exec remote-cnc-api bash -c "cd core && alembic upgrade head"
# You can access the web app in <http://localhost:3000>
# The API will initialize in <http://localhost:8000>
# You can access adminer through <http://localhost:8080>
You can also run the project in production
mode:
# Run the project in production mode
$ docker-compose -f docker-compose.yaml -f docker-compose.production.yaml up -d
- All tests:
# We run the command inside the container
$ docker exec -it remote-cnc-api make tests
- Linter:
$ docker exec -it remote-cnc-app npm run lint:check
- Unit tests:
$ docker exec -it remote-cnc-app npm run test:unit
In order to deploy the app, you must export it as a static site. To do so, you must run the following command in development mode:
$ docker exec -it remote-cnc-app npm run build
Then, if you want, you can deploy the project with docker-compose:
# Run the project in production mode
$ docker-compose -f docker-compose.yaml -f docker-compose.production.yaml up -d
Also, take into account that you must update the environment variables.
A more comprehensive guide about the deployment here.
This project is under license from MIT. For more details, see the LICENSE file.
Made with ❤️ by Leandro Bertoluzzi and Martín Sellart.