Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
281 commits
Select commit Hold shift + click to select a range
95bf1d7
scss - fixed some warnings
lakesare Aug 28, 2025
8fb8bc3
scss - a couple of bright-theme css fixes
lakesare Aug 29, 2025
f0ea527
<ImportFlashcardsFromText/> - initial implementation
lakesare Aug 29, 2025
72baaf8
<ImportFlashcardsFromText/> - created instructions for LLM
lakesare Aug 29, 2025
5a0a31a
<ImportFlashcardsFromText/> - added instructions for LLM
lakesare Aug 29, 2025
86933a9
excel imports - fix the order
lakesare Aug 29, 2025
d892cfb
/courses/:id - fix SHIFT-selection
lakesare Aug 29, 2025
68735e8
courses/:id - add visual feedback to SHIFT
lakesare Aug 29, 2025
e6d9c7e
/courses/:id - make unselect work more intuitively
lakesare Aug 29, 2025
cbf9e9c
/courses/:id - make SHIFT-clicking prettier
lakesare Aug 29, 2025
c1fd926
<ImportFromExcel/> - fix position of newly-added flashcards
lakesare Sep 1, 2025
3077603
<Import/> - refresh the page right away after the imports
lakesare Sep 1, 2025
8292664
/api/importFromExcel.js - deal with positions
lakesare Sep 1, 2025
a0b14eb
<Flashcard/> - fix the "forever loading" placeholder issue
lakesare Sep 2, 2025
7b33d69
everywhere - remove "Please consider making it public" note
lakesare Sep 2, 2025
af25153
<CourseActions/> - move the import menu to the ". . ." menu
lakesare Sep 2, 2025
8cd60a7
removing webpack - change import paths
lakesare Sep 3, 2025
c446be9
removing webpack - change entire setup
lakesare Sep 3, 2025
b49f76d
removing webpack - restore some packages
lakesare Sep 3, 2025
4c67604
removing webpack - update setup instructions
lakesare Sep 3, 2025
3b8734e
Update Readme.md
lakesare Sep 3, 2025
4c7970d
WARP.md - generate
lakesare Sep 4, 2025
9ed8bc5
/admin/users - make it possible to delete users
lakesare Sep 4, 2025
ac07f0f
/admin - add proper authentication for admin endpoints
lakesare Sep 4, 2025
3690901
/admin - we only need one success message
lakesare Sep 4, 2025
8ddbfe4
css - rename @import to @use (removes sass warnings)
lakesare Sep 4, 2025
908e4e7
css - use a compiled font-awesome css (removes sass warnings)
lakesare Sep 4, 2025
6d9e4e3
css - silence all warnings
lakesare Sep 4, 2025
22b129d
Upgrading to heroku-24
lakesare Sep 4, 2025
42024b1
Gitpod - remove gitpod
lakesare Sep 4, 2025
6cf061e
tests - remove all tests
lakesare Sep 4, 2025
7597f0e
services/getUserAvatar.js - create a default avatar
lakesare Sep 4, 2025
c615558
everywhere - add signups via username&password
lakesare Sep 4, 2025
88b12e6
migrations/15.sql - run on heroku
lakesare Sep 5, 2025
b4f80a0
Makefile - make setup instructions much more clear
lakesare Sep 5, 2025
2ea7059
<Notifications/> - mark notifications as seen after opening the dropdown
lakesare Sep 5, 2025
118507b
~/services/isUserAdmin.js - move to the traditional /services folder
lakesare Sep 5, 2025
2e62f8e
<Notifications/> - make notification dropdown not get reset as we mov…
lakesare Sep 5, 2025
0c03cd5
<Notifications/> - submit api requests too
lakesare Sep 5, 2025
e873d0a
/courses - record ?searchQuery in the url
lakesare Sep 5, 2025
f9ae26c
<Notifications/> - make them less glitchyon page travel
lakesare Sep 5, 2025
252ecde
backend/api/PageApi - convert
lakesare Sep 5, 2025
db75176
backend/api/CourseApi - convert
lakesare Sep 5, 2025
0481a63
backend/api/urls.js - prettier formatting
lakesare Sep 5, 2025
136f906
backend/api/AuthApi - convert
lakesare Sep 5, 2025
a2fa207
backend - fully converted to a new format!
lakesare Sep 5, 2025
612fecf
frontend/api/FileApi.js - remove & move code closer to where it's used
lakesare Sep 5, 2025
a5151f5
UserModel.js - convert to knex
lakesare Sep 6, 2025
66ca885
css - remove `font-weight: 100` everywhere
lakesare Sep 6, 2025
852f96a
css - fix "too much height for 'email" issue
lakesare Sep 6, 2025
dfbd1a7
CourseUserIsLearningModel.js - convert to knex
lakesare Sep 6, 2025
e9ac359
CourseCategoryModel.js - convert to knex
lakesare Sep 6, 2025
3f98a06
ProblemUserIsLearning.js - convert to knex
lakesare Sep 6, 2025
53c0a1b
NotificationModel.js - convert to knex (partial)
lakesare Sep 6, 2025
d44a60f
./setupNewUser.js - factor our common logic in authentication
lakesare Sep 6, 2025
3385f09
NotificationModel.js - convert to knex (full)
lakesare Sep 6, 2025
b3436bf
CourseRatingModel.js - convert to knex
lakesare Sep 6, 2025
6c2eb7e
CourseModel.js - convert to knex (guaranteed parts)
lakesare Sep 6, 2025
0e0bba3
CourseModel.js - convert to knex (riskier)
lakesare Sep 6, 2025
c8fff10
ProblemModel.js - move 'service function here
lakesare Sep 6, 2025
160bbad
<ImportFlashcardsFromText/> - add to instructions "2+ answers in cloz…
lakesare Sep 6, 2025
9f344a1
./frontend/nonWebpackedFiles - delete unused files
lakesare Sep 6, 2025
e5668f1
TTS - backend
lakesare Sep 6, 2025
d222309
TTS - frontend
lakesare Sep 6, 2025
e71f912
service-worker.js - cache busting solution
lakesare Sep 7, 2025
1453b21
css - prettier per-flashcard buttons on small screens
lakesare Sep 7, 2025
7945e98
TTS - clean html tags for consistent caching
lakesare Sep 7, 2025
0cfddf5
css - fix css warnings about the ordering of rules
lakesare Sep 7, 2025
4e18017
TTS - in parts
lakesare Sep 7, 2025
025e531
css - make .sound-button visible on :focus
lakesare Sep 7, 2025
93734fe
TTS - triple repetition of 'word
lakesare Sep 7, 2025
2dea74a
TTS - really cool word. word? word! sentence
lakesare Sep 7, 2025
4e2c7bf
TTS - precache
lakesare Sep 8, 2025
a570447
TTS - dont autoread cloze-deletion flashcards
lakesare Sep 8, 2025
b6550a3
css - fix in-between spacing for "separate-answer" flashcards
lakesare Sep 8, 2025
73634ef
<ImportModal/> - show one-click-away on page
lakesare Sep 8, 2025
db2fff8
everywhere - fix positions
lakesare Sep 8, 2025
5dd336a
17.sql - make flashcard order sequential
lakesare Sep 8, 2025
0c8bbae
./services/TtsPrecache.js - only cache automatic sounds
lakesare Sep 8, 2025
806d6b5
./bright-theme.css - add border-radius in bright theme to everything
lakesare Sep 8, 2025
1300d97
./frontend/index.html - remove, we don't use it
lakesare Sep 8, 2025
2002ef5
css - prevent theme flash
lakesare Sep 8, 2025
3f10118
./CourseApi/updateCourse.js - fix course update errors
lakesare Sep 9, 2025
c7f042a
Makefile - use heroku url directly instead of a named remote
lakesare Sep 9, 2025
895eea0
<Logo/> - automatic Christmas&Halloween logos
lakesare Sep 9, 2025
8b2ccc9
./router.js - render /courses if the url is missing
lakesare Sep 9, 2025
d28fad7
<CourseCreationModal/> - remove /courses/new, use a modal instead
lakesare Sep 9, 2025
dfdf13d
./bright-theme.css - add a bright theme for the courses dropdown
lakesare Sep 9, 2025
89bdbd8
<SequenceTtsService/> - handle multiple cloze-deleted words too
lakesare Sep 9, 2025
0a3b05c
TTS - refactor
lakesare Sep 9, 2025
0bb428c
TTS - remove in-memory storage
lakesare Sep 9, 2025
c0bee20
TTS - refactor
lakesare Sep 9, 2025
04db6cb
TTS - voice should be 'shimmer'
lakesare Sep 9, 2025
4f01f90
css - fix the sync button position on mobile
lakesare Sep 10, 2025
b8039c4
./webpack/sharedConfig.js - readable :local() css classNames
lakesare Sep 10, 2025
1fc4195
css - better <header/> on mobile
lakesare Sep 10, 2025
abcbebd
css - better user page on mobile
lakesare Sep 10, 2025
3d110c6
<SettingsModal/> - remove settings button from the /user/:id
lakesare Sep 10, 2025
4b23a86
<Header/> - add a dropdown with [Profile, Settings, SwitchTheme] items
lakesare Sep 10, 2025
124d69e
<ThemeToggleButton/> - synchronize across app
lakesare Sep 10, 2025
6c430e6
<SettingsModal/> - use selects instead
lakesare Sep 10, 2025
a9aeebd
./ducks/SettingsDuck.js - move all settings to a single place
lakesare Sep 10, 2025
68a6d6c
./ducks/SettingsDuck.js - fix remaining `props.Settings` calls
lakesare Sep 10, 2025
1a38fb1
<SettingsModal/> - more compact UI; use `formState` instead of separa…
lakesare Sep 10, 2025
9eca7e8
<SettingsModal/> - make the modal get closed after save
lakesare Sep 10, 2025
a398e41
everywhere - fix positioning hopefully
lakesare Sep 10, 2025
3e56c9e
everywhere - convert some POST requests to GET
lakesare Sep 10, 2025
4f12fa3
everywhere - explicit `api.post` and `api.get` everywhere
lakesare Sep 10, 2025
96ee2b7
/api/CourseApi.getPublicCourses - optimize
lakesare Sep 10, 2025
9ca53bd
/api/CourseApi.getPublickCourses - fix remaining issues
lakesare Sep 10, 2025
078d96d
./service/hashToQueryString.js - fix remaining `api.get.` urls
lakesare Sep 11, 2025
5544cb0
<TabImportExport/> - make css work on mobile
lakesare Sep 11, 2025
4659ef5
<ImportExportModal/> - move to `~/appComponents`
lakesare Sep 11, 2025
c227141
<ImportExportModal/>, <EditModal/> - make visible on mobiles
lakesare Sep 11, 2025
92edcae
./bright-theme.scss - make the profile-settings dropdown work in brig…
lakesare Sep 11, 2025
8ddd2ef
./bright-theme.scss - make .notifications-dropdown bright too
lakesare Sep 11, 2025
91caf23
backend - revamp authentication!
lakesare Sep 11, 2025
a4ad546
<CourseActions/> - update courseCategory in the UI too
lakesare Sep 11, 2025
657f874
./bright-theme.scss - round border-radius for readonly courses too
lakesare Sep 11, 2025
ced8321
./auth.js - use `isUserAdmin()` service everywhere
lakesare Sep 11, 2025
0591be7
./bright-theme.scss - keep the font darkish even when we have a backg…
lakesare Sep 11, 2025
8ee182f
CourseApi.getStudentStats() - make the query more efficient
lakesare Sep 12, 2025
e43e0a1
/articles/... - fix grammar
lakesare Sep 12, 2025
a86a62e
/articles/welcome - add TTS to benefits
lakesare Sep 13, 2025
7ccd530
<AccountModal/> - make it possible to edit username/email/avatar
lakesare Sep 13, 2025
b55cb62
<ImportExportModal/> - add "export to text" functionality
lakesare Sep 13, 2025
44df357
./SettingsDuck.js - recover "Pinned Courses" functionality
lakesare Sep 13, 2025
75f0492
UserApi.updateAccount.js - let the users keep their username, even if…
lakesare Sep 13, 2025
a05e114
CourseApi.getStudentStats.js - show all learners
lakesare Sep 13, 2025
37aa6d0
CourseApi.getStudentStats.js - still sort the learners
lakesare Sep 13, 2025
8cc6c06
CourseApi.getStudentStats.js - fix!
lakesare Sep 13, 2025
13dcfc8
/admin - add admin Stats page
lakesare Sep 13, 2025
0d6d542
./placeholdAndCreateImage.js - add automatic image compression
lakesare Sep 13, 2025
354c111
<CourseActions/> - show course-edit updates immediately
lakesare Sep 13, 2025
bebb1c6
everywhere - cleanup
lakesare Sep 13, 2025
b6da037
~/_docs - remove
lakesare Sep 13, 2025
2bcc9be
ProblemApi.update() - fix the flashcard reordering
lakesare Sep 13, 2025
ec64b8f
/admin - adjust section content
lakesare Sep 13, 2025
d32af9e
/admin - adjust scrollable-table css
lakesare Sep 13, 2025
6a4eba6
/admin - remove "Ratings" section
lakesare Sep 13, 2025
92fd32a
/admin/stats - add "Recent Reviews" section
lakesare Sep 13, 2025
1a27364
<NavigationAdmin/> - only highlight Stats when we're exactly on the s…
lakesare Sep 14, 2025
99ca06e
AdminApi.announceNewFeature() - mv from NotificationApi.announceNewFe…
lakesare Sep 14, 2025
45208ee
./bright-theme.scss - make /courses look a bit better
lakesare Sep 14, 2025
785b967
/courses - better CSS for both dark&bright theme
lakesare Sep 14, 2025
0d14705
/courses - add "Selected" section
lakesare Sep 14, 2025
60ac666
/courses - add sections
lakesare Sep 14, 2025
199f6f0
/courses - add swedish
lakesare Sep 14, 2025
9702f24
/courses - remove "(Animals)"
lakesare Sep 14, 2025
e963f45
CourseApi.getSelectedCourses() - make username&category appear
lakesare Sep 14, 2025
4e29976
/courses - better styling
lakesare Sep 14, 2025
d7c052b
<CourseCreationModal/> - make the loading state look good
lakesare Sep 14, 2025
79fee8e
./bight-theme.scss - exclude articles pages from the bright theme
lakesare Sep 14, 2025
0889f9a
/articles/welcome - add selected courses to /welcome page too
lakesare Sep 14, 2025
4dc7d37
/admin - better css for reviewed-flashcards section
lakesare Sep 14, 2025
c138e86
Change image source in Readme.md
lakesare Sep 14, 2025
4fd1630
Change project description heading from h2 to h3
lakesare Sep 14, 2025
1e15434
Merge branch 'master' of github.com:lakesare/memcode
lakesare Sep 14, 2025
1e40ec3
Contributing.md - create
lakesare Sep 14, 2025
4b3a730
Readme.md - remove a list of links
lakesare Sep 14, 2025
de7cae4
Update description in Readme.md
lakesare Sep 15, 2025
41da4e2
Add live demo link to README
lakesare Sep 15, 2025
4a24616
Enhance Readme with focus on learning experience
lakesare Sep 15, 2025
e758819
Update Readme.md
lakesare Sep 15, 2025
219088e
Update live demo link to localhost
lakesare Sep 15, 2025
903adba
Update live demo link in Readme.md
lakesare Sep 15, 2025
1a77df8
./bright-theme.scss - made articles 100% not have bright-theme styles
lakesare Sep 15, 2025
15b5f26
./bright-theme.scss - made header look good when the user is not sign…
lakesare Sep 15, 2025
c9778bb
./bright-theme.scss - make sign-in button always highlighted
lakesare Sep 15, 2025
0a39a33
<Header/> - less vaporwavey sign-in button
lakesare Sep 15, 2025
9aed4ad
./bright-theme.scss - make the sign-in modal bright-themed
lakesare Sep 15, 2025
7f8578d
<CourseActions/> - slightly bigger font-size
lakesare Sep 15, 2025
a781c8c
<StatsModal/> - only load student stats when the user opens the modal
lakesare Sep 15, 2025
5802d36
/courses/:id/learn - revamp /learn page design
lakesare Sep 15, 2025
538cc37
<DeleteFlashcardsModal/> - move to ~/appComponents
lakesare Sep 15, 2025
bcedf39
/learn/:id - implement deletion
lakesare Sep 15, 2025
57c33c4
/learn/:id - better instructions
lakesare Sep 15, 2025
21605b6
meresei - add title & logo
lakesare Sep 15, 2025
f1fa98c
meresei - fix SCSS deprecation warnings
lakesare Sep 15, 2025
a8ecb45
memcode - add a /demo route
lakesare Sep 16, 2025
8058878
/review - only display the "Next review: " if we actually have next r…
lakesare Sep 16, 2025
dffa259
<Header/> - create placeholder when no-flashcards-to-review
lakesare Sep 16, 2025
dbf1b0e
/admin - show n of users that reviewed flashcards
lakesare Sep 16, 2025
c72b3d0
/admin - show per-day user stats
lakesare Sep 16, 2025
92e21c1
/admin - better css for tables
lakesare Sep 16, 2025
e5d7074
./bright-theme.scss - remove flashcard bg from /courses/:id page
lakesare Sep 16, 2025
a1b2c9f
./CourseModel.js - fix PropType warnings
lakesare Sep 16, 2025
ea0ffef
<Header/> n-of-flashcards circle - better css
lakesare Sep 16, 2025
3f56df4
<Header/> - fix bright-theme bell color
lakesare Sep 17, 2025
1e104d8
<Header/> - remove "User" text while the image is loading
lakesare Sep 17, 2025
58ea523
<Header/> - make avatar square again
lakesare Sep 17, 2025
aa17e21
Revert "<Header/> - make avatar square again"
lakesare Sep 19, 2025
96c27bc
Update Readme.md
lakesare Sep 19, 2025
43d2af8
Update Readme.md
lakesare Sep 19, 2025
1e6f44a
./backend/emails - add updated_2025.html email
lakesare Sep 20, 2025
b4be96f
<AccountModal/> - added "subscribe/unsubscribe to emails" select
lakesare Sep 20, 2025
09983fa
Merge remote-tracking branch 'github/master'
lakesare Sep 20, 2025
cfe538c
/privacy - create a /privacy page
lakesare Sep 20, 2025
a337b9b
./migrations/19.sql - ran
lakesare Sep 20, 2025
e84023a
./emails - add a link to memcode.com/privacy
lakesare Sep 20, 2025
41daa50
meresei - add /about page template
lakesare Sep 21, 2025
e6c3d24
meresei - add /sleep-tracker calculator
lakesare Sep 21, 2025
ba99d66
meresei - use .container
lakesare Sep 21, 2025
43ab5f9
meresei - add burger-menu on mobile
lakesare Sep 21, 2025
aa92390
meresei - add real content to /about
lakesare Sep 21, 2025
bcfd950
meresei - remove obvs excessive stuff
lakesare Sep 21, 2025
84e16ad
meresei - start writing /sleep-tracker
lakesare Sep 21, 2025
1083b06
meresei - comment out /sleep-tracker for now
lakesare Sep 21, 2025
5dfc044
meresei - better logo animation
lakesare Sep 21, 2025
83aca6a
meresei - rewrote "How to determine your sleep schedule" article
lakesare Sep 21, 2025
dd599b2
meresei - put before/after in a table
lakesare Sep 22, 2025
e2d5eac
meresei - add the stats calculator back
lakesare Sep 22, 2025
ffc1ec2
meresei - remove excessive stuff from the graph
lakesare Sep 22, 2025
a8afe53
./backend/index.js - more clear meresei/memcode setup
lakesare Sep 22, 2025
2959bc5
meresei - factor out Chart.tsx
lakesare Sep 22, 2025
682491d
mereesi - improve chart's textarea css
lakesare Sep 22, 2025
ac869f6
meresei - better logo css
lakesare Sep 22, 2025
8b495fe
memcode - better css for emails/update_2025.html
lakesare Sep 22, 2025
9d70bb6
Makefile - add `make heroku-export-emails` command
lakesare Sep 23, 2025
78af6fa
memcode - recover red-bar for failed reviews
lakesare Sep 23, 2025
3124d75
meresei - /sleep-tracker => /cure
lakesare Sep 23, 2025
b6dffd2
meresei - clean up html a bit
lakesare Sep 23, 2025
973af91
meresei - fix brick height
lakesare Sep 23, 2025
21f5797
meresei - add 'clock picture
lakesare Sep 23, 2025
56081be
meresei - better <textarea/> css
lakesare Sep 23, 2025
acbf7a5
meresei - add introduction to Cure article
lakesare Sep 23, 2025
c3852d5
meresei - finished article
lakesare Sep 23, 2025
e75378e
meresei - final blog post type
lakesare Sep 23, 2025
1f16fdb
meresei - edit last paragraph
lakesare Sep 25, 2025
eedf34a
meresei - make /cure more compact on mobiles
lakesare Sep 26, 2025
0c2a7dd
memcode - don't react to repeated-click on cloze-deleted answer
lakesare Sep 30, 2025
6cbfac8
<InlinedAnswersReview/> - make double-click work as NEXT button
lakesare Sep 30, 2025
79aca3a
placeholdAndCreateImage.js - remove compression for now
lakesare Oct 15, 2025
e8aea51
<Editor/> - make click-on-img-toolbar image insertion work
lakesare Oct 15, 2025
80f5223
<FocusModeModal/> - implement focus mode on memcode
lakesare Oct 17, 2025
656436b
<Header/> - add a small indicator for the focus mode
lakesare Oct 17, 2025
d4a2337
<Flashcard/> - don't compress the image if SHIFT was pressed
lakesare Oct 18, 2025
3de1782
github codespaces - docker attempt
lakesare Oct 18, 2025
b904492
github codespaces - live reload
lakesare Oct 18, 2025
8eba3a2
github codespaces - add a section explaining how to use them to Contr…
lakesare Oct 18, 2025
1fa92e8
<FocusModal/> - enable focusing courses by title
lakesare Oct 24, 2025
dae3bd1
css - better "no-courses-yet" dropdown styling
lakesare Oct 24, 2025
4f3a9e0
<Header/> - make links span the full height
lakesare Oct 24, 2025
5f9d441
<Header/> - make header taller
lakesare Oct 24, 2025
70fa2a2
<FocusModal/> - add a matching list of courses
lakesare Oct 24, 2025
6ecc62c
<Flashcard/> - disable image compression
lakesare Nov 10, 2025
41b47c9
~/isPatreonUsername.js - update patreon usernames
lakesare Nov 20, 2025
7b9a35a
<FocusModal/> - better css
lakesare Jan 13, 2026
b722398
/review - make the cursor in the editor "simple arrow"
lakesare Jan 14, 2026
0e7721f
/review - move "Next" button on top
lakesare Jan 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "Memcode Development",
"dockerComposeFile": "../docker-compose.yml",
"service": "app",
"workspaceFolder": "/app",

// Configure tool-specific properties
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint"
],
"settings": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
}
},


// Use 'forwardPorts' to make a list of ports inside the container available locally
"forwardPorts": [3000, 5432, 9229],
"portsAttributes": {
"3000": {
"label": "Memcode App",
"onAutoForward": "openBrowser"
},
"5432": {
"label": "PostgreSQL Database"
},
"9229": {
"label": "Debug Port",
"protocol": "debug"
}
},

// Use 'postCreateCommand' to run commands after the container is created
"postCreateCommand": "chmod +x docker-setup.sh && ./docker-setup.sh setup && ./docker-setup.sh start-bg",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root
"remoteUser": "node"
}
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

7 changes: 0 additions & 7 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ module.exports = {
},
"globals": {
"fetch": true,
"it": true,
"expect": true,
"alert": true,
"document": true,
"localStorage": true,
Expand All @@ -288,11 +286,6 @@ module.exports = {
"URL": true,
"Image": true,

// in our tests
"describe": true,
"expect": true,
"beforeEach": true,

// things I make global with ProvidePlugin
"React": true,
"PropTypes": true,
Expand Down
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms
# Support Memcode development

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: memcode
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ npm-debug.log
.DS_Store

lakesare.secrets.js
/meresei/**
/meresei/frontend/node_modules
/meresei/frontend/dist
10 changes: 0 additions & 10 deletions .gitpod.Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions .gitpod.yml

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
52 changes: 52 additions & 0 deletions Contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Contributing

First of all - you are welcome to contribute, Memcode is a joint effort.
Feel free to ask questions/propose features in github issues, or email [email protected].

# Github Codespaces

If you would like to develop in the browser, you can simply open Github Codespaces - after a few minutes of waiting, in the PORTS tab, a few ports will appear. Click on the port 3000. This will open a browser window, where you can see normal memcode.com ui.
You can now edit both frontend and backend code in Github Codespaces - the changes will get reflected in the ui automatically.

When developing in Github Codespaces, please username&password to register.

# Local setup

### One-Time Setup

#### Create a database

1. Install PostgreSQL (any modern should work, for example v14.17 and v16.9 certainly work)
2. Go to postgres console: `psql postgres` (as the default postgres superuser)
3. Create a `memcode` user with password: `CREATE ROLE memcode WITH LOGIN PASSWORD 'memcode';`.
4. Give the user permission to create databases: `ALTER ROLE memcode CREATEDB;`.
5. Create a new development database 'memcode': `make db-reset`. This will create the raw database for you - a schema and a few necessary database rows.

> [!NOTE]
> The project uses a PostgreSQL user named `memcode` with password `memcode` for the database `memcode`. All database commands in the Makefile are configured to use these credentials.

#### Copypaste environment variables

1. Copy the example environment file with `cp env.example.js env.js`

For basic development you do not need to change anything in this file.

#### Install the needed libraries

1. Install node v22.19.0
1. Install npm
2. Run `npm install`

### Development

1. Run `make frontend-webpack` (compiles the frontend code)
2. Run `make start` (starts the node server)
2. Go to <a href="http://localhost:3000/">http://localhost:3000</a>, and enjoy the development!
Locally, please use username&password to sign up.

<br/>
<div align="center">
<img width="50px" src="https://user-images.githubusercontent.com/7578559/154219522-280c4f96-4e3d-45e9-9beb-671b339b3f92.png" alt="Memcode Logo"/>
</div>

___
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Use Node.js 22 as specified in package.json
FROM node:22-alpine

# Install system dependencies
RUN apk add --no-cache \
python3 \
make \
g++ \
postgresql-client \
bash

# Create app directory
WORKDIR /app

# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm install --legacy-peer-deps

# Copy source code
COPY . .

# Make entrypoint script executable
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

# Expose port 3000
EXPOSE 3000

# Use custom entrypoint script
ENTRYPOINT ["/docker-entrypoint.sh"]
30 changes: 0 additions & 30 deletions Gitpod.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Evgenia Karunus
Copyright (c) 2016-present Evgenia Karunus

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
76 changes: 23 additions & 53 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,77 +1,47 @@

all:
make start & make backend-webpack & make frontend-webpack

# $(npm bin)/nodemon doesn't work, npm bin is '' then.
# _______________________________DEVELOPMENT_______________________________
start:
NODE_ENV=development node_modules/.bin/nodemon --inspect --watch backend backend/webpacked/index.js
NODE_ENV=development node_modules/.bin/nodemon --inspect --watch backend backend/index.js

# build and watch
backend-webpack:
cd backend; ../node_modules/.bin/webpack --config ./webpack/development.config.js -w
frontend-webpack:
cd frontend; ../node_modules/.bin/webpack --config ./webpack/development.config.js -w
cd frontend; NODE_OPTIONS="--openssl-legacy-provider" ../node_modules/.bin/webpack --config ./webpack/development.config.js -w

# database
LOCAL_DB_URL = postgresql://memcode:memcode@localhost/memcode
LOCAL_POSTGRES_URL = postgresql://memcode:memcode@localhost/postgres
db-drop:
psql -U postgres -c 'DROP DATABASE IF EXISTS memcode'
psql $(LOCAL_POSTGRES_URL) -c 'DROP DATABASE IF EXISTS memcode'
db-reset:
# 'database=' here is a variable used in schema.sql (-v).
psql -v database=memcode -U postgres -f backend/db/schema.sql
make db-drop
psql $(LOCAL_POSTGRES_URL) -c 'CREATE DATABASE memcode'
psql $(LOCAL_DB_URL) -f backend/db/schema.sql
db-migrate:
psql -v database=memcode -U postgres -f backend/db/migrations/14.sql

# dump and restore data
db-dump:
pg_dump -d memcode -U postgres > backend/db/dump.sql
db-restore:
psql -d memcode -U postgres < backend/db/dump.sql
psql $(LOCAL_DB_URL) -f backend/db/migrations/19.sql

# test
test-db-reset:
psql -v database=memcode_test -U postgres -f backend/db/schema.sql
test-backend:
cd backend; NODE_ENV=test ../node_modules/.bin/mocha --recursive ./webpacked/test --require babel-polyfill --require source-map-support/register
test-frontend:
cd frontend; NODE_ENV=test ../node_modules/.bin/karma start

# production
# _______________________________PRODUCTION_______________________________
# ___Why don't we run `npm install`?
# `npm install` is run automatically. since we need to compile code on heroku, we need our devDependencies installed too. so I set `heroku config:set NPM_CONFIG_PRODUCTION=false` for this purpose.
heroku-postbuild:
# npm install
# is run automatically. since we need to compile code on heroku, we need our devDependencies installed too. so I set
# heroku config:set NPM_CONFIG_PRODUCTION=false
# for this purpose.
touch env.js;
make heroku-backend-webpack &
make heroku-frontend-webpack

make heroku-frontend-webpack &
make heroku-meresei-frontend-webpack
heroku-deploy:
git push heroku master

heroku-backend-webpack:
cd backend; ../node_modules/.bin/webpack --config ./webpack/production.config.js
git push https://git.heroku.com/memcode.git master
heroku-frontend-webpack:
cd frontend; ../node_modules/.bin/webpack --config ./webpack/production.config.js

cd frontend; NODE_OPTIONS="--openssl-legacy-provider" ../node_modules/.bin/webpack --config ./webpack/production.config.js
heroku-meresei-frontend-webpack:
cd meresei/frontend; npm install && npm run production

DB_URL = $$(heroku config:get DATABASE_URL --app memcode)
# ___Where did we get these credentials from?
# Find our credentials from `heroku config`
# ___How to run a particular migration?
# Manually input migration you want to run (eg 1.sql)
# ___Where is 7.sql taken from?
# From local files!
heroku-db-migrate:
psql -v database=d9glthq2q1grjs $(DB_URL) -f backend/db/migrations/14.sql
heroku-db-console:
psql -v $(DB_URL)

psql $$(heroku config:get DATABASE_URL --app memcode) -f backend/db/migrations/19.sql
# when they ask for password - they ask for the local one (yes, 4 times)
heroku-db-pull:
make db-drop
PGUSER=postgres PGPASSWORD=§1§1§1 heroku pg:pull DATABASE_URL memcode --app memcode

# when they ask for password - they ask for the local one (yes, 4 times)
# heroku-pg-push:
# PGUSER=postgres heroku pg:reset DATABASE_URL
# PGUSER=postgres heroku pg:push memcode DATABASE_URL --app memcode
heroku pg:pull DATABASE_URL memcode --app memcode
heroku-export-emails:
psql $$(heroku config:get DATABASE_URL --app memcode) -c "\COPY (SELECT DISTINCT email FROM \"user\" WHERE email IS NOT NULL AND is_subscribed_to_marketing_emails = true ORDER BY email) TO STDOUT WITH CSV HEADER" > emails.csv
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

34 changes: 34 additions & 0 deletions README-DOCKER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Memcode Docker Setup

## Quick Start

**Local Development:**
```bash
git clone https://github.com/lakesare/memcode.git
cd memcode
./docker-setup.sh setup
./docker-setup.sh start
```

**GitHub Codespaces:**
Just open in Codespaces - automatically starts!

Open http://localhost:3000 when ready

## Commands

```bash
./docker-setup.sh setup # First time setup
./docker-setup.sh start # Start Memcode
./docker-setup.sh stop # Stop Memcode
./docker-setup.sh logs # View logs
./docker-setup.sh reset # Reset everything
```

## Manual Docker Commands

```bash
docker-compose up # Start
docker-compose down # Stop
docker-compose down -v # Reset (deletes data)
```
Loading