You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NIddle is a middleware service that acts as an interface between the official University of Porto website (Sigarra) and the UNI mobile application. The primary goal of NIddle is to provide a stable, modern, and reliable API for the UNI app, abstracting away the complexities of the Sigarra website.
14
+
NIddle is a service dedicated to managing and providing static data for the UNI mobile application. It serves as a central hub for university-related information such as faculty and course events, academic services, and student association content.
27
15
28
-
This approach allows for a more agile development process for the UNI mobile app, as changes in Sigarra can be handled by NIddle without requiring a new release of the mobile app. Additionally, NIddle introduces custom functionalities not available in Sigarra, such as a custom announcement system.
16
+
The primary goal of NIddle is to provide a reliable and easily maintainable API for the UNI app, ensuring that static resources are kept up-to-date and accessible without the need for frequent application releases.
29
17
30
18
## Features
31
19
32
-
-**Stable API**: Provides a consistent API for schedules, exams, and other university data, protecting the mobile app from changes in the underlying source.
33
-
-**Decoupled Architecture**: Separates the mobile app from the university's web services, allowing for independent development and deployment cycles.
34
-
-**Extensible**: Easily add new features and endpoints to support the mobile app.
35
-
-**Custom Functionalities**: Includes additional features not present in Sigarra, such as a dedicated announcement system.
20
+
-**Stable API**: Provides a consistent and reliable API for faculty events, course information, and student association data.
21
+
-**Modern Tech Stack**: Built with [NestJS](https://nestjs.com/), [TypeORM](https://typeorm.io/), and [PostgreSQL](https://www.postgresql.org/).
22
+
-**API Documentation**: Interactive documentation powered by [Swagger](https://swagger.io/).
23
+
-**Database Management**: Easy schema management and data seeding for development.
24
+
-**Typescript First**: Fully typed API for better developer experience and reliability.
25
+
-**CI/CD Ready**: Automated testing and linting with GitHub Actions.
26
+
-**Containerized**: Support for Docker and Nix for consistent environments.
27
+
28
+
## API Documentation
29
+
30
+
NIddle comes with built-in API documentation using Swagger. Once the application is running, you can access the documentation at:
31
+
32
+
```
33
+
http://localhost:3000/docs
34
+
```
35
+
36
+
This provides an interactive interface to explore and test the available endpoints.
36
37
37
38
## Getting Started
38
39
@@ -77,20 +78,48 @@ These instructions will get you a copy of the project up and running on your loc
77
78
npm install
78
79
```
79
80
80
-
5. **Run the application**
81
+
5. **Seed the database (Optional)**
82
+
83
+
If you want to populate the database with some initial data:
84
+
85
+
```bash
86
+
npm run seed
87
+
```
88
+
89
+
6. **Run the application**
81
90
82
91
```bash
83
92
npm run start:dev
84
93
```
85
94
86
95
The application will be running in watch mode at `http://localhost:3000`.
87
96
97
+
## Nix Support
98
+
99
+
If you use [Nix](https://nixos.org/), this project includes a flake that provides a development shell with all the necessary tools (Node.js 22, Nest CLI, etc.).
100
+
101
+
```bash
102
+
nix develop
103
+
```
104
+
105
+
This ensures a consistent development environment across different machines.
106
+
88
107
## Docker
89
108
90
109
NIddle is fully containerized and can be easily built and run as a Docker image.
91
110
92
111
### Building the Image
93
112
113
+
- **Run the build script**
114
+
115
+
The `build_image.sh` script will build the Docker image for you.
116
+
117
+
```bash
118
+
./build_image.sh
119
+
```
120
+
121
+
### Running the Image
122
+
94
123
1. **Set up Docker environment variables**
95
124
96
125
Copy the example environment file to `.env.docker`.
@@ -101,32 +130,36 @@ NIddle is fully containerized and can be easily built and run as a Docker image.
101
130
102
131
Open `.env.docker` and configure the variables for the Docker environment.
103
132
104
-
2. **Run the build script**
133
+
2. **Run the run script**
105
134
106
-
The `build_image.sh` script will build the Docker image for you.
135
+
The `run_image.sh` script will start a container from the image and inject the environment variables from `.env.docker`.
107
136
108
137
```bash
109
-
./build_image.sh
138
+
./run_image.sh
110
139
```
111
140
112
-
### Running the Image
141
+
## Available Scripts
113
142
114
-
- **Run the run script**
143
+
### Development & Build
115
144
116
-
The `run_image.sh` script will start a container from the image you just built.
145
+
- `npm run build`: Compiles the project to the `dist` folder.
146
+
- `npm run start`: Starts the application.
147
+
- `npm run start:dev`: Starts the application in development mode with watch mode.
148
+
- `npm run start:prod`: Starts the application from the compiled production build.
149
+
- `npm run seed`: Seeds the database with sample data.
117
150
118
-
```bash
119
-
./run_image.sh
120
-
```
151
+
### Quality & Linting
121
152
122
-
## Available Scripts
153
+
- `npm run check`: Runs both linting and formatting checks.
154
+
- `npm run check:fix`: Automatically fixes linting and formatting issues.
155
+
- `npm run lint`: Lints the codebase using Biome.
156
+
- `npm run format`: Formats the codebase using Biome.
157
+
158
+
### Testing
123
159
124
-
- `npm run build`: Compiles the project.
125
-
- `npm run format`: Formats the code using Biome.
126
-
- `npm run start:prod`: Starts the application in production mode.
127
-
- `npm run start:dev`: Starts the application in development mode with watch.
128
-
- `npm run lint`: Lints the codebase.
129
160
- `npm test`: Runs unit tests.
161
+
- `npm run test:watch`: Runs unit tests in watch mode.
162
+
- `npm run test:cov`: Runs unit tests and generates coverage reports.
0 commit comments