Skip to content

Commit

Permalink
delete supabase
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilan-riviere committed Jul 4, 2024
1 parent 4dac6e6 commit 592e3f1
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 239 deletions.
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ PORT=3000
HOST=localhost
HTTPS=false
ENV=development # development, production, test
TOKEN=123456789 # generate with `openssl rand -hex 12`

APP_PORT=3000 # only used with docker-compose
APP_PORT=3000
39 changes: 0 additions & 39 deletions .vscode/old/supabase.ts

This file was deleted.

90 changes: 23 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ Some podcast services offer a RSS feed with HTML render if RSS feed is requested
- [ ] Better locale support
- [ ] Add CORS support

## Docker

You can use `docker compose` to run the application.

Create `.env` file

```bash
cp .env.example .env
```

- `PORT`: internal port of the container (default `3000`)
- `HOST`: host of the application
- `HTTPS`: false (`true` or `false`)
- `ENV`: environment (`development`, `production`, `test`)
- `APP_PORT`: external port of the container (default `3000`)

Docker compose will use the `.env` file to set environment variables.

```bash
docker compose down
docker compose up -d
```

## Usage

Feedrender API offers some endpoints to execute different tasks.
Expand Down Expand Up @@ -105,73 +128,6 @@ Query parameters

Example: <https://feedrender.git-projects.xyz/api/xml?url=https://feedpress.me/rdvjeux>

## Installation

### Docker

You can use `docker compose` or `docker` to run the application.

#### Docker compose

Create `.env` file

```bash
cp .env.example .env
```

Docker compose will use the `.env` file to set environment variables.

```bash
docker compose up -d
```

#### Docker image

Build and run the docker image

```bash
docker build -t feedrender-app:latest .
docker run -it -p 3000:3000 feedrender-app:latest
```

### Local

Download dependencies

```bash
pnpm i
```

Create `.env` file

```bash
cp .env.example .env
```

Run dev server

```bash
pnpm dev
```

Go to [localhost:3000](http://localhost:3000)

### Build

Build application

```bash
pnpm build
```

Local preview

```bash
pnpm start
```

You can use PM2 to run application in production.

## Tests

Run tests
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
services:
app:
feedrender:
container_name: feedrender
build:
context: .
Expand Down
Binary file removed dump.rdb
Binary file not shown.
13 changes: 13 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
server {
listen 80;
listen [::]:80;
http2 on;
server_name domain.com;

location / {
proxy_pass http://127.0.0.1:3000;
}

access_log /var/log/nginx/feedrender.access.log;
error_log /var/log/nginx/feedrender.error.log;
}
7 changes: 0 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import { createApp } from 'h3'
import { router } from './routes'

// import { createUsersTable } from './services/database'
import './functions'

export const app = createApp()
app.use(router)

// createUsersTable()
// cron.schedule('*/15 * * * * *', () => {
// consola.info('node-cron task (every 15 seconds)')
// })
103 changes: 0 additions & 103 deletions src/models/User.ts

This file was deleted.

7 changes: 0 additions & 7 deletions src/routes/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ export default async () => {
about: 'Parse XML RSS feed and return XML (useful for feeds with HTML render)',
example: route('/api/xml', { query: { url: 'https://feedpress.me/rdvjeux' } }),
},
// register: {
// url: route('/api/register'),
// query: {
// url: '`string`, required, url to RSS feed (could be base64 encoded)',
// },
// about: 'Register RSS feed and return JSON',
// },
},
}
}
11 changes: 0 additions & 11 deletions src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,9 @@ import apiRender from './api/render'
import apiJson from './api/json'
import apiXml from './api/xml'

// import apiRegister from './api/register'
// import apiLogin from './api/login'
// import apiUser from './api/user'
// import apiUsers from './api/users'
// import apiDelete from './api/delete'

export const router = createRouter()
.get('/', createRoute(root))
.get('/api', createRoute(api))
.get('/api/render', createRoute(apiRender))
.get('/api/json', createRoute(apiJson))
.get('/api/xml', createRoute(apiXml))
// .post('/api/register', createRoute(apiRegister))
// .post('/api/login', createRoute(apiLogin))
// .get('/api/user', createRoute(apiUser))
// .get('/api/users', createRoute(apiUsers))
// .get('/api/delete', createRoute(apiDelete))
2 changes: 0 additions & 2 deletions src/services/dotenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export interface IDotenv {
HOST: string
HTTPS: boolean
ENV: 'development' | 'production' | 'test'
TOKEN: string
SUPABASE_URL: string
SUPABASE_KEY: string
NODE_ENV?: string
Expand Down Expand Up @@ -40,7 +39,6 @@ export class Dotenv {
HOST: host,
HTTPS: https,
ENV: env,
TOKEN: process.env.TOKEN ?? '123456789',
SUPABASE_URL: process.env.SUPABASE_URL ?? '',
SUPABASE_KEY: process.env.SUPABASE_KEY ?? '',
baseURL,
Expand Down

0 comments on commit 592e3f1

Please sign in to comment.