Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DATABASE_URL="postgresql://user:password@localhost:5432/mydb"
JWT_SECRET="change-me"
PORT=3000
2 changes: 1 addition & 1 deletion .github/workflows/dokku-audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
fetch-depth: 0
- name: run dokku audit
uses: 3sidedcube/dokku@v1.0.0
uses: 3sidedcube/dokku@v1.0.1
with:
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/dokku.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
fetch-depth: ${{ github.event_name == 'pull_request' && 0 || 2 }}
fetch-depth: 0
- name: fetch base branch
if: github.event_name == 'pull_request'
run: git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
- name: get diff
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
git diff origin/${{ github.base_ref }}...HEAD -- '*.ts' '*.js' '*.py' '*.go' '*.rs' ':!**/*.test.*' ':!**/tests/**' ':!.github/**' > diff.txt
git diff ${{ github.base_ref }}...HEAD -- '*.ts' '*.js' '*.py' '*.go' '*.rs' ':!**/*.test.*' ':!**/tests/**' ':!.github/**' > diff.txt
else
git diff HEAD~1 HEAD -- '*.ts' '*.js' '*.py' '*.go' '*.rs' ':!**/*.test.*' ':!**/tests/**' > diff.txt
fi
- name: run dokku
uses: 3sidedcube/dokku@v1.0.0
uses: 3sidedcube/dokku@v1.0.1
with:
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ npm-debug.log*
# IDE
.vscode/
.idea/

/generated/prisma
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@
$ npm install
```

## Environment Variables

Create a `.env` file in the root directory and configure the following variables:

```env
DATABASE_URL="postgresql://username:password@localhost:5432/database_name"
JWT_SECRET="your-secret-key"
```

## Database Setup

This project uses Prisma as the ORM. To set up the database:

```bash
# Generate Prisma client
$ npx prisma generate

# Run database migrations
$ npx prisma migrate dev

# Optional: Seed the database
$ npx prisma db seed
```

## Compile and run the project

```bash
Expand All @@ -44,6 +68,27 @@ $ npm run start:dev
$ npm run start:prod
```

## API Endpoints

The application includes the following authentication endpoints:

### Authentication
- `POST /auth/register` - Register a new user
```json
{
"email": "user@example.com",
"password": "password123"
}
```

- `POST /auth/login` - Login with email and password
```json
{
"email": "user@example.com",
"password": "password123"
}
```

## Run tests

```bash
Expand Down Expand Up @@ -95,4 +140,4 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors

## License

Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).
Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).
Loading