Add .env.example

This commit is contained in:
ADAMJR 2022-12-16 23:19:48 +00:00
parent e467aabddf
commit 3cb890b511
12 changed files with 46 additions and 113 deletions

View File

@ -5,14 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## v[0.3.0] The late winter update.
## v[0.4.0a] Winter
### Added
- Create, share, and customize themes.
...More things will be listed here when I remember what I added, it's been a long time. The version number may not be accurate...
<!-- [unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.3.0...HEAD -->
[0.3.0]: https://github.com/accord-dot-app/app/compare/v0.3.0...HEAD
- Profanity filter: Text channel option to filter explicit words (disabled by default).
- Customizable themes: Create, share, and customize UI themes.

View File

@ -1,4 +1,4 @@
# Accord - Like Discord but cooler 😎.
# Accord - Messaging Made Simple.
> Built with React, Redux, and Node.js.
@ -90,6 +90,6 @@ WEBSITE_URL="http://localhost:4200"
---
### Further Info
### Worth checking out...
- Looking for a full Discord API Clone? Check out [fosscord](https://github.com/fosscord/fosscord).
- Check out [fosscord](https://github.com/fosscord/fosscord).

6
backend/.env.example Normal file
View File

@ -0,0 +1,6 @@
EMAIL_ADDRESS="example@example.com"
EMAIL_PASSWORD="password"
MONGO_URI="mongodb://localhost/accord"
NODE_ENV="dev"
PORT=3000
WEBSITE_URL="http://localhost:4200"

View File

@ -1,39 +0,0 @@
# Accord - API
Tested code that brings Accord to life.
![Lines of Code](https://img.shields.io/tokei/lines/github/d-clone/API?color=46828d&style=for-the-badge)
> © All rights reserved. This repo is not (yet) open source, and is awaiting completion.
## Non-Docker Setup .env
If you are not using Docker, you can use the following template as a guide.
### `.env`
```.env
API_URL="http://localhost:3000/api"
EMAIL_ADDRESS="example@gmail.com"
EMAIL_PASSWORD="google_account_password"
MONGO_URI="mongodb://localhost/accord"
PORT=3000
ROOT_ENDPOINT="http://localhost:3000"
WEBSITE_URL="http://localhost:4200"
```
## Docker Setup .env
If you are using Docker, some variables will be substituted by Docker.
```.env
API_URL="http://localhost:3000/api"
EMAIL_ADDRESS="example@gmail.com"
EMAIL_PASSWORD="google_account_password"
MONGO_URI="mongodb://database/accord"
PORT=3000
ROOT_ENDPOINT="http://localhost:3000"
WEBSITE_URL="http://localhost:4200"
```
> For help on setting up gmail, go here - https://nodemailer.com/usage/using-gmail.

View File

@ -1,4 +1,4 @@
import { Entity, REST, UserTypes } from '@acrd/types';
import { REST, UserTypes } from '@acrd/types';
import { Router } from 'express';
import { User } from '../../data/models/user';
import generateInvite from '../../data/utils/generate-invite';
@ -65,7 +65,7 @@ router.get('/entities', updateUser, validateUser, async (req, res) => {
GuildMember.find({ guildId: { $in } }),
Role.find({ guildId: { $in } }),
Theme.find({ _id: { $in: user.unlockedThemeIds } }),
User.find({ guildIds: { $in } }),
User.find({ guildIds: { $in } })
]);
const secureUsers = unsecureUsers.map((u: any) => deps.users.secure(u));
@ -76,7 +76,7 @@ router.get('/entities', updateUser, validateUser, async (req, res) => {
members,
roles,
themes,
users: secureUsers,
users: secureUsers
} as REST.From.Get['/users/entities']);
});

View File

@ -1,46 +0,0 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).

View File

@ -22,7 +22,7 @@ const MessageHeader: FunctionComponent<MessageHeaderProps> = ({ author, message,
<div>
<ContextMenuTrigger id={author.id}>
<span
style={{ color: highestRole?.color }}
style={{ color: highestRole?.color ?? 'var(--font)' }}
className="text-base heading hover:underline cursor-pointer mr-2">{author.username}</span>
</ContextMenuTrigger>
<span className="text-xs">

View File

@ -1,31 +1,41 @@
import { useDispatch, useSelector } from 'react-redux';
import { useParams } from 'react-router';
import { getGuildInvites } from '../../../store/guilds';
import { getGuild, getGuildInvites, getGuildUsers } from '../../../store/guilds';
import { deleteInvite } from '../../../store/invites';
import { openSaveChanges } from '../../../store/ui';
import Username from '../../user/username';
import CircleButton from '../../utils/buttons/circle-button';
const GuildSettingsInvites: React.FunctionComponent = () => {
const dispatch = useDispatch();
const { guildId }: any = useParams();
const invites = useSelector(getGuildInvites(guildId));
const guild = useSelector(getGuild(guildId));
const guildUsers = useSelector(getGuildUsers(guildId));
const Invites = () => (
<div className="mt-2">
{invites.map(i => (
<div className="w-full mb-3">
<strong>{i.id}</strong>
<strong><code>{i.id}</code></strong>
<span className="pl-5 secondary">
<span>Used <code>{i.uses}</code> times</span>
<span>Created by <Username
user={guildUsers.find(gu => gu.id == i.inviterId)}
guild={guild} /></span>
</span>
<span className="float-right">
<button
<CircleButton
type="button"
className="danger rounded-full border-2 border-danger px-2"
onClick={() => dispatch(deleteInvite(i.id))}>x</button>
style={{ borderColor: 'var(--danger)', color: 'var(--danger)' }}
onClick={() => dispatch(deleteInvite(i.id))}>X</CircleButton>
</span>
</div>
))}
{!invites.length && <span>No invites created.</span>}
</div>
);
return (
<form
onChange={() => dispatch(openSaveChanges(true))}
@ -33,10 +43,10 @@ const GuildSettingsInvites: React.FunctionComponent = () => {
<header>
<h1 className="text-xl font-bold inline">Invites</h1>
</header>
<Invites />
</form>
</form>
);
}
export default GuildSettingsInvites;

View File

@ -14,4 +14,8 @@ section h1 {
.image-card img {
height: 125px;
}
a {
color: var(--tertiary) !important;
}

View File

@ -83,13 +83,14 @@ const HomePage: React.FunctionComponent = () => {
<ImageCard src={Chat} title="Chat Made Simple">
Accord focuses on just the practical features and a simple messaging solution.
</ImageCard>
<ImageCard src={Devices} title="On Mobile or Desktop">
<ImageCard src={Devices} title="Mobile or Desktop">
(work in progress)
</ImageCard>
<ImageCard src={Friends} title="Join and Manage Guilds">
Create and customize your own messaging spaces for your friends.
</ImageCard>
<ImageCard src={Secure} title="Secure Messages">
Accord is also <a href={process.env.REACT_APP_REPO} target="_blank">open-source on GitHub</a>.
(work in progress)
</ImageCard>
</section>

View File

@ -32,7 +32,7 @@ const Username: React.FunctionComponent<UsernameProps> = ({ guild, user, size =
};
return (
<span className="rounded-full absolute flex -right-0.5 -bottom-0.5">
<span className="rounded-full absolute inline-flex -right-0.5 -bottom-0.5">
<span
style={{ border: '2px solid var(--bg-secondary)' }}
className={classNames(

View File

@ -5,8 +5,10 @@ declare global {
REACT_APP_API_URL: string;
REACT_APP_CDN_URL: string;
REACT_APP_REPO: string;
REACT_APP_VERSION_NAME: string;
REACT_APP_VERSION_NUMBER: string;
REACT_APP_ROOT_API_URL: string;
}
}
}
export {};
export { };